package com.baobao.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllParents", query = "select myParent from Parent myParent"),
		@NamedQuery(name = "findParentByAccount", query = "select myParent from Parent myParent where myParent.account = ?1"),
		@NamedQuery(name = "findParentByAccountContaining", query = "select myParent from Parent myParent where myParent.account like ?1"),
		@NamedQuery(name = "findParentByBbId1", query = "select myParent from Parent myParent where myParent.bbId1 = ?1"),
		@NamedQuery(name = "findParentByBbId1Containing", query = "select myParent from Parent myParent where myParent.bbId1 like ?1"),
		@NamedQuery(name = "findParentByBbId2", query = "select myParent from Parent myParent where myParent.bbId2 = ?1"),
		@NamedQuery(name = "findParentByBbId2Containing", query = "select myParent from Parent myParent where myParent.bbId2 like ?1"),
		@NamedQuery(name = "findParentByBbId3", query = "select myParent from Parent myParent where myParent.bbId3 = ?1"),
		@NamedQuery(name = "findParentByBbId3Containing", query = "select myParent from Parent myParent where myParent.bbId3 like ?1"),
		@NamedQuery(name = "findParentByBbId4", query = "select myParent from Parent myParent where myParent.bbId4 = ?1"),
		@NamedQuery(name = "findParentByBbId4Containing", query = "select myParent from Parent myParent where myParent.bbId4 like ?1"),
		@NamedQuery(name = "findParentByBbId5", query = "select myParent from Parent myParent where myParent.bbId5 = ?1"),
		@NamedQuery(name = "findParentByBbId5Containing", query = "select myParent from Parent myParent where myParent.bbId5 like ?1"),
		@NamedQuery(name = "findParentByName", query = "select myParent from Parent myParent where myParent.name = ?1"),
		@NamedQuery(name = "findParentByNameContaining", query = "select myParent from Parent myParent where myParent.name like ?1"),
		@NamedQuery(name = "findParentByPassword", query = "select myParent from Parent myParent where myParent.password = ?1"),
		@NamedQuery(name = "findParentByPasswordContaining", query = "select myParent from Parent myParent where myParent.password like ?1"),
		@NamedQuery(name = "findParentByPhone", query = "select myParent from Parent myParent where myParent.phone = ?1"),
		@NamedQuery(name = "findParentByPhoneContaining", query = "select myParent from Parent myParent where myParent.phone like ?1"),
		@NamedQuery(name = "findParentByPrimaryKey", query = "select myParent from Parent myParent where myParent.phone = ?1"),
		@NamedQuery(name = "findParentByRelation", query = "select myParent from Parent myParent where myParent.relation = ?1") })
@Table(catalog = "baobaodb", name = "parent")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "bb/com/baobao/domain", name = "Parent")
public class Parent implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "phone", length = 40, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	String phone;
	/**
	 */

	@Column(name = "name", length = 100)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String name;
	/**
	 */

	@Column(name = "account", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String account;
	/**
	 */

	@Column(name = "password", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String password;
	/**
	 */

	@Column(name = "relation")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer relation;
	/**
	 */

	@Column(name = "bb_id_1", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String bbId1;
	/**
	 */

	@Column(name = "bb_id_2", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String bbId2;
	/**
	 */

	@Column(name = "bb_id_3", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String bbId3;
	/**
	 */

	@Column(name = "bb_id_4", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String bbId4;
	/**
	 */

	@Column(name = "bb_id_5", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String bbId5;

	/**
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 */
	public String getPhone() {
		return this.phone;
	}

	/**
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 */
	public String getName() {
		return this.name;
	}

	/**
	 */
	public void setAccount(String account) {
		this.account = account;
	}

	/**
	 */
	public String getAccount() {
		return this.account;
	}

	/**
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 */
	public String getPassword() {
		return this.password;
	}

	/**
	 */
	public void setRelation(Integer relation) {
		this.relation = relation;
	}

	/**
	 */
	public Integer getRelation() {
		return this.relation;
	}

	/**
	 */
	public void setBbId1(String bbId1) {
		this.bbId1 = bbId1;
	}

	/**
	 */
	public String getBbId1() {
		return this.bbId1;
	}

	/**
	 */
	public void setBbId2(String bbId2) {
		this.bbId2 = bbId2;
	}

	/**
	 */
	public String getBbId2() {
		return this.bbId2;
	}

	/**
	 */
	public void setBbId3(String bbId3) {
		this.bbId3 = bbId3;
	}

	/**
	 */
	public String getBbId3() {
		return this.bbId3;
	}

	/**
	 */
	public void setBbId4(String bbId4) {
		this.bbId4 = bbId4;
	}

	/**
	 */
	public String getBbId4() {
		return this.bbId4;
	}

	/**
	 */
	public void setBbId5(String bbId5) {
		this.bbId5 = bbId5;
	}

	/**
	 */
	public String getBbId5() {
		return this.bbId5;
	}

	/**
	 */
	public Parent() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Parent that) {
		setPhone(that.getPhone());
		setName(that.getName());
		setAccount(that.getAccount());
		setPassword(that.getPassword());
		setRelation(that.getRelation());
		setBbId1(that.getBbId1());
		setBbId2(that.getBbId2());
		setBbId3(that.getBbId3());
		setBbId4(that.getBbId4());
		setBbId5(that.getBbId5());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("phone=[").append(phone).append("] ");
		buffer.append("name=[").append(name).append("] ");
		buffer.append("account=[").append(account).append("] ");
		buffer.append("password=[").append(password).append("] ");
		buffer.append("relation=[").append(relation).append("] ");
		buffer.append("bbId1=[").append(bbId1).append("] ");
		buffer.append("bbId2=[").append(bbId2).append("] ");
		buffer.append("bbId3=[").append(bbId3).append("] ");
		buffer.append("bbId4=[").append(bbId4).append("] ");
		buffer.append("bbId5=[").append(bbId5).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((phone == null) ? 0 : phone.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Parent))
			return false;
		Parent equalCheck = (Parent) obj;
		if ((phone == null && equalCheck.phone != null) || (phone != null && equalCheck.phone == null))
			return false;
		if (phone != null && !phone.equals(equalCheck.phone))
			return false;
		return true;
	}
}
